import type { Metadata } from "next";
import { GeistSans } from "geist/font/sans";
import { ThemeProvider } from "@/providers/theme-provider";
import { Navbar } from "@/components/layout/navbar";
import "./globals.css";
import { AuthProvider } from "@/contexts/auth-context";
import { WelcomeModal } from "@/components/common/WelcomeModal";

export const metadata: Metadata = {
  title: "心身同调·全维健康",
  description: "用科技守护健康，用数据改善生活",
};

export default function RootLayout({
  children,
}: {
  children: React.ReactNode;
}) {
  return (
    <html lang="zh" suppressHydrationWarning>
      <body className={GeistSans.className}>
        <AuthProvider>
          <ThemeProvider
            attribute="class"
            defaultTheme="system"
            enableSystem
            disableTransitionOnChange
          >
            <div className="relative min-h-screen bg-background">
              <Navbar />
              <main className="container pt-16">{children}</main>
              <WelcomeModal />
            </div>
          </ThemeProvider>
        </AuthProvider>
      </body>
    </html>
  );
}
